package com.qijian.common.utils;

import cn.hutool.http.HttpUtil;
import com.qijian.common.utils.http.HttpUtils;

/**
 * 益戈同步
 */
public class HDDangerUtil {

    private final static String DANGER_URL = "https://afx.ehsway.com/api/open/data/hdDangerZJXNY?appKey=abb5e12b89a44bc8acca54b423448280&appSecret=df46690694124f8cace794ddc874a96e";
    private final static String TRAIN_PLAN_URL = "https://afx.ehsway.com/api/open/data/eduTrainingPlanZJXNY?appKey=abb5e12b89a44bc8acca54b423448280&appSecret=df46690694124f8cace794ddc874a96e";


    public static void main(String[] args) {
        String startDate = "2023-05-20";
        String endDate = "2023-06-20";
        String dateDangerUrl = DANGER_URL + "&startDate=" + startDate + "&endDate=" + endDate;
        HttpUtils.sendGet(dateDangerUrl);
        String s = HttpUtil.get(dateDangerUrl);
        System.out.println("开始==================================================================================================================："+HttpUtils.sendGet(dateDangerUrl));
        System.out.println("=========================================================结束=======================================================");

        /*String trainPlanUrl = TRAIN_PLAN_URL + "&startDate=" + startDate + "&endDate=" + endDate;
        System.out.println("开始==================================================================================================================："+HttpUtils.sendGet(trainPlanUrl));
        System.out.println("=========================================================结束=======================================================");*/
//        System.out.println(DateUtils.getDate());

    }

    public static String getDangerUrl(String startDate, String endDate) {
        String dateDangerUrl = DANGER_URL + "&startDate=" + startDate + "&endDate=" + endDate;
        return HttpUtil.get(dateDangerUrl);
    }

    public static String getTrainPlanUrl(String startDate, String endDate) {
        String trainPlanUrl = TRAIN_PLAN_URL + "&startDate=" + startDate + "&endDate=" + endDate;
        return HttpUtil.get(trainPlanUrl);
    }

}
//https://afx.ehsway.com/api/open/data/hdDangerZJXNY?appKey=abb5e12b89a44bc8acca54b423448280&appSecret=df46690694124f8cace794ddc874a96e&startDate=2020-01-01&endDate=2022-10-12
//https://afx.ehsway.com/api/open/data/hdDangerZJXNY?appKey=abb5e12b89a44bc8acca54b423448280&appSecret=df46690694124f8cace794ddc874a96e&startDate=2020-09-01&endDate=2022-10-12
